package com.demo.command18;

public class Client {
		public static void main(String[] a)
		{
			Television tv = new Television();
                        Command openCommand,closeCommand,changeCommand;
			
			openCommand = new OpenTvCommand(tv);
			closeCommand = new CloseTvCommand(tv);
			changeCommand = new ChangeChannelCommand(tv);
			
			Controller control = new Controller(openCommand,closeCommand,changeCommand);
			
			control.open();           //打开电视机
			control.change();         //换频道
			control.change();
			control.ChannelUndo();
			control.ChannelUndo();
			control.ChannelUndo();
			control.close();          //关闭电视机
		}
}